import request from "@/utils/request";
import { PRODUCE } from "@/config/baseUrl.js";

// 查询列表
export function getMainData(data) {
  return request({
    url: `${PRODUCE}/report/mainProduce/query`,
    method: "post",
    data,
  });
}

// 查询明细表列表
export function getDetailData(data) {
  return request({
    url: `${PRODUCE}/report/orderDetail/query`,
    method: "post",
    data,
  });
}

// 计划完成情况月报表导出
export function exportPlanCompleteMain(data) {
  return request({
    url: `${PRODUCE}/report/mainProduce/exportOrderCompleteReport`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 计划完成情况明细报表导出
export function exportPlanCompleteDetail(data) {
  return request({
    url: `${PRODUCE}/report/orderDetail/exportCompleteDetail`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 产能利用率月报表导出
export function exportCapacityUseMain(data) {
  return request({
    url: `${PRODUCE}/report/mainProduce/exportCapacityUseReport`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 产能利用率明细报表导出
export function exportCapacityUseDetail(data) {
  return request({
    url: `${PRODUCE}/report/orderDetail/exportCapacityUseDetail`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 生产效率&故障率月报表导出
export function exportStoppageMain(data) {
  return request({
    url: `${PRODUCE}/report/mainProduce/exportStoppageReport`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 生产效率&故障率明细导出
export function exportStoppageDetail(data) {
  return request({
    url: `${PRODUCE}/report/orderDetail/exportStoppageDetail`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 核心设备故障明细
export function getEquipAbStopDetail(data) {
  return request({
    url: `${PRODUCE}/report/detailEquipAbStop/query`,
    method: "post",
    data,
  });
}

// 核心设备故障明细导出
export function exportEquipAbStopDetail(data) {
  return request({
    url: `${PRODUCE}/report/detailEquipAbStop/exportEquipStopDetail`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 能耗月报表查询
export function getEnergyMain(data) {
  return request({
    url: `${PRODUCE}/reportEnergy/mainEnergy/query`,
    method: "post",
    data,
  });
}

// 能耗月报表导出
export function exportEnergyMain(data) {
  return request({
    url: `${PRODUCE}/reportEnergy/mainEnergy/export`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 能耗明细报表查询
export function getEnergyDetail(data) {
  return request({
    url: `${PRODUCE}/reportEnergy/detailEnergy/query`,
    method: "post",
    data,
  });
}

// 能耗明细报表导出
export function exportEnergyDetail(data) {
  return request({
    url: `${PRODUCE}/reportEnergy/detailEnergy/export`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 物料损耗月报表查询
export function getMaterialMain(data) {
  return request({
    url: `${PRODUCE}/reportMaterial/mainMaterial/query`,
    method: "post",
    data,
  });
}

// 物料损耗月报表导出
export function exportMaterialMain(data) {
  return request({
    url: `${PRODUCE}/reportMaterial/mainMaterial/export`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 物料损耗明细表查询
export function getMaterialDetail(data) {
  return request({
    url: `${PRODUCE}/reportMaterial/detailOrderMaterial/query`,
    method: "post",
    data,
  });
}

// 物料损耗明细表导出
export function exportMaterialDetail(data) {
  return request({
    url: `${PRODUCE}/reportMaterial/detailOrderMaterial/export`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 人效月报表查询
export function getUserEfficiencyMain(data) {
  return request({
    url: `${PRODUCE}/reportGroup/mainUserEfficiency/query`,
    method: "post",
    data,
  });
}

// 人效月报表导出
export function exportUserEfficiencyMain(data) {
  return request({
    url: `${PRODUCE}/reportGroup/mainUserEfficiency/export`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 人效明细报表查询
export function getUserEfficiencyDetail(data) {
  return request({
    url: `${PRODUCE}/reportGroup/detailProduceGroup/query`,
    method: "post",
    data,
  });
}

// 人效明细报表导出
export function exportUserEfficiencyDetail(data) {
  return request({
    url: `${PRODUCE}/reportGroup/detailProduceGroup/export`,
    method: "post",
    responseType: "blob",
    data,
  });
}

// 人员生产工时明细报表查询
export function getUserWorkhoursDetail(data) {
  return request({
    url: `${PRODUCE}/reportGroup/detailProduceUser/query`,
    method: "post",
    data,
  });
}

// 人员生产工时明细报表导出
export function exportUserWorkhoursDetail(data) {
  return request({
    url: `${PRODUCE}/reportGroup/detailProduceUser/export`,
    method: "post",
    responseType: "blob",
    data,
  });
}